
#ifndef DEEP_H
#define DEEP_H

#ifdef _WIN32 // Windows
#include <wtypes.h>
typedef unsigned __int64 QWORD;
#else
#include <stdint.h>
#define WINAPI
#define CALLBACK
typedef uint8_t BYTE;
typedef uint16_t WORD;
typedef uint32_t DWORD;
typedef uint64_t QWORD;
typedef int BOOL;
#define TRUE 1
#define FALSE 0
#define LOBYTE(a) (BYTE)(a)
#define LOWORD(a) (WORD)(a)
#define HIWORD(a) (WORD)((a)>>16)
#define MAKELONG(a,b) (DWORD)(((a)&0xffff)|((b)<<16))
#endif

#ifdef __cplusplus
extern "C" {
#endif

#define DEEPVERSION 0x100	

#ifndef DEEPDEF
#define DEEPDEF(f) WINAPI f
#endif

typedef DWORD HMUSIC;		
typedef DWORD HSAMPLE;		
typedef DWORD HCHANNEL;		
typedef DWORD HSTREAM;		
typedef DWORD HRECORD;		
typedef DWORD HSYNC;		
typedef DWORD HDSP;			
typedef DWORD HFX;			
typedef DWORD HPLUGIN;		

#define DEEP_OK				0	
#define DEEP_ERROR_MEM		1	
#define DEEP_ERROR_FILEOPEN	2	
#define DEEP_ERROR_DRIVER	3	
#define DEEP_ERROR_BUFLOST	4	
#define DEEP_ERROR_HANDLE	5	
#define DEEP_ERROR_FORMAT	6	
#define DEEP_ERROR_POSITION	7	
#define DEEP_ERROR_INIT		8	
#define DEEP_ERROR_START	9	
#define DEEP_ERROR_ALREADY	14	
#define DEEP_ERROR_NOPAUSE	16	
#define DEEP_ERROR_NOCHAN	18	
#define DEEP_ERROR_ILLTYPE	19	
#define DEEP_ERROR_ILLPARAM	20	
#define DEEP_ERROR_NO3D		21	
#define DEEP_ERROR_NOEAX	22	
#define DEEP_ERROR_DEVICE	23	
#define DEEP_ERROR_NOPLAY	24	
#define DEEP_ERROR_FREQ		25	
#define DEEP_ERROR_NOTFILE	27	
#define DEEP_ERROR_NOHW		29	
#define DEEP_ERROR_EMPTY	31	
#define DEEP_ERROR_NONET	32	
#define DEEP_ERROR_CREATE	33	
#define DEEP_ERROR_NOFX		34	
#define DEEP_ERROR_PLAYING	35	
#define DEEP_ERROR_NOTAVAIL	37	
#define DEEP_ERROR_DECODE	38	
#define DEEP_ERROR_DX		39	
#define DEEP_ERROR_TIMEOUT	40	
#define DEEP_ERROR_FILEFORM	41	
#define DEEP_ERROR_SPEAKER	42	
#define DEEP_ERROR_VERSION	43	
#define DEEP_ERROR_CODEC	44  
#define DEEP_ERROR_UNKNOWN	-1	

#define DEEP_DEVICE_8BITS	1	
#define DEEP_DEVICE_MONO	2	
#define DEEP_DEVICE_3D		4	
#define DEEP_DEVICE_LATENCY	256	
#define DEEP_DEVICE_SPEAKERS 2048	
#define DEEP_DEVICE_NOSPEAKER 4096	

#define DEEP_OBJECT_DS		1	
#define DEEP_OBJECT_DS3DL	2	

typedef struct {
	DWORD flags;	
	DWORD hwsize;	
	DWORD hwfree;	
	DWORD freesam;	
	DWORD free3d;	
	DWORD minrate;	
	DWORD maxrate;	
	BOOL eax;		
	DWORD minbuf;	
	DWORD dsver;	
	DWORD latency;	
	DWORD initflags;
	DWORD speakers; 
	const char *driver;	
	DWORD freq;		
} DEEP_INFO;

#define DSCAPS_CONTINUOUSRATE	0x00000010
#define DSCAPS_EMULDRIVER		0x00000020
#define DSCAPS_CERTIFIED		0x00000040
#define DSCAPS_SECONDARYMONO	0x00000100	
#define DSCAPS_SECONDARYSTEREO	0x00000200	
#define DSCAPS_SECONDARY8BIT	0x00000400	
#define DSCAPS_SECONDARY16BIT	0x00000800	

typedef struct {
	DWORD flags;	
	DWORD formats;	
	DWORD inputs;	
	BOOL singlein;	
	const char *driver;	
	DWORD freq;		
} DEEP_RECORDINFO;

#define DSCCAPS_EMULDRIVER	DSCAPS_EMULDRIVER	
#define DSCCAPS_CERTIFIED	DSCAPS_CERTIFIED	

#ifndef WAVE_FORMAT_1M08
#define WAVE_FORMAT_1M08       0x00000001       
#define WAVE_FORMAT_1S08       0x00000002       
#define WAVE_FORMAT_1M16       0x00000004       
#define WAVE_FORMAT_1S16       0x00000008       
#define WAVE_FORMAT_2M08       0x00000010       
#define WAVE_FORMAT_2S08       0x00000020       
#define WAVE_FORMAT_2M16       0x00000040       
#define WAVE_FORMAT_2S16       0x00000080       
#define WAVE_FORMAT_4M08       0x00000100       
#define WAVE_FORMAT_4S08       0x00000200       
#define WAVE_FORMAT_4M16       0x00000400       
#define WAVE_FORMAT_4S16       0x00000800       
#endif

typedef struct {
	DWORD freq;		
	DWORD volume;	
	int pan;		
	DWORD flags;	
	DWORD length;	
	DWORD max;		
	DWORD origres;	
	DWORD chans;	
	DWORD mingap;	
	DWORD mode3d;	
	float mindist;	
	float maxdist;	
	DWORD iangle;	
	DWORD oangle;	
	DWORD outvol;	
	DWORD vam;		
	DWORD priority;	
} DEEP_SAMPLE;

#define DEEP_SAMPLE_8BITS		1	
#define DEEP_SAMPLE_FLOAT		256	
#define DEEP_SAMPLE_MONO		2	
#define DEEP_SAMPLE_LOOP		4	
#define DEEP_SAMPLE_3D			8	
#define DEEP_SAMPLE_SOFTWARE	16	
#define DEEP_SAMPLE_MUTEMAX		32	
#define DEEP_SAMPLE_VAM			64	
#define DEEP_SAMPLE_FX			128	
#define DEEP_SAMPLE_OVER_VOL	0x10000	
#define DEEP_SAMPLE_OVER_POS	0x20000	
#define DEEP_SAMPLE_OVER_DIST	0x30000 

#define DEEP_STREAM_PRESCAN		0x20000 
#define DEEP_MP3_SETPOS			DEEP_STREAM_PRESCAN
#define DEEP_STREAM_AUTOFREE	0x40000	
#define DEEP_STREAM_RESTRATE	0x80000	
#define DEEP_STREAM_BLOCK		0x100000
#define DEEP_STREAM_DECODE		0x200000
#define DEEP_STREAM_STATUS		0x800000

#define DEEP_MUSIC_FLOAT		DEEP_SAMPLE_FLOAT 
#define DEEP_MUSIC_MONO			DEEP_SAMPLE_MONO 
#define DEEP_MUSIC_LOOP			DEEP_SAMPLE_LOOP
#define DEEP_MUSIC_3D			DEEP_SAMPLE_3D 
#define DEEP_MUSIC_FX			DEEP_SAMPLE_FX
#define DEEP_MUSIC_AUTOFREE		DEEP_STREAM_AUTOFREE 
#define DEEP_MUSIC_DECODE		DEEP_STREAM_DECODE 
#define DEEP_MUSIC_PRESCAN		DEEP_STREAM_PRESCAN
#define DEEP_MUSIC_CALCLEN		DEEP_MUSIC_PRESCAN
#define DEEP_MUSIC_RAMP			0x200	
#define DEEP_MUSIC_RAMPS		0x400	
#define DEEP_MUSIC_SURROUND		0x800	
#define DEEP_MUSIC_SURROUND2	0x1000	
#define DEEP_MUSIC_FT2MOD		0x2000	
#define DEEP_MUSIC_PT1MOD		0x4000	
#define DEEP_MUSIC_NONINTER		0x10000	
#define DEEP_MUSIC_POSRESET		0x8000	
#define DEEP_MUSIC_POSRESETEX	0x400000
#define DEEP_MUSIC_STOPBACK		0x80000	
#define DEEP_MUSIC_NOSAMPLE		0x100000

#define DEEP_SPEAKER_FRONT	0x1000000	
#define DEEP_SPEAKER_REAR	0x2000000	
#define DEEP_SPEAKER_CENLFE	0x3000000	
#define DEEP_SPEAKER_REAR2	0x4000000	
#define DEEP_SPEAKER_N(n)	((n)<<24)	
#define DEEP_SPEAKER_LEFT	0x10000000	
#define DEEP_SPEAKER_RIGHT	0x20000000	
#define DEEP_SPEAKER_FRONTLEFT	DEEP_SPEAKER_FRONT|DEEP_SPEAKER_LEFT
#define DEEP_SPEAKER_FRONTRIGHT	DEEP_SPEAKER_FRONT|DEEP_SPEAKER_RIGHT
#define DEEP_SPEAKER_REARLEFT	DEEP_SPEAKER_REAR|DEEP_SPEAKER_LEFT
#define DEEP_SPEAKER_REARRIGHT	DEEP_SPEAKER_REAR|DEEP_SPEAKER_RIGHT
#define DEEP_SPEAKER_CENTER		DEEP_SPEAKER_CENLFE|DEEP_SPEAKER_LEFT
#define DEEP_SPEAKER_LFE		DEEP_SPEAKER_CENLFE|DEEP_SPEAKER_RIGHT
#define DEEP_SPEAKER_REAR2LEFT	DEEP_SPEAKER_REAR2|DEEP_SPEAKER_LEFT
#define DEEP_SPEAKER_REAR2RIGHT	DEEP_SPEAKER_REAR2|DEEP_SPEAKER_RIGHT

#define DEEP_UNICODE			0x80000000

#define DEEP_RECORD_PAUSE		0x8000	

#define MAKEMUSICPOS(order,row) (0x80000000|MAKELONG(order,row))

#define DEEP_VAM_HARDWARE		1
#define DEEP_VAM_SOFTWARE		2
#define DEEP_VAM_TERM_TIME		4
#define DEEP_VAM_TERM_DIST		8
#define DEEP_VAM_TERM_PRIO		16

typedef struct {
	DWORD freq;		
	DWORD chans;	
	DWORD flags;	
	DWORD ctype;	
	DWORD origres;	
	HPLUGIN plugin;	
} DEEP_CHANNELINFO;

#define DEEP_CTYPE_SAMPLE		1
#define DEEP_CTYPE_RECORD		2
#define DEEP_CTYPE_STREAM		0x10000
#define DEEP_CTYPE_STREAM_OGG	0x10002
#define DEEP_CTYPE_STREAM_MP1	0x10003
#define DEEP_CTYPE_STREAM_MP2	0x10004
#define DEEP_CTYPE_STREAM_MP3	0x10005
#define DEEP_CTYPE_STREAM_AIFF	0x10006
#define DEEP_CTYPE_STREAM_WAV	0x40000 
#define DEEP_CTYPE_STREAM_WAV_PCM	0x50001
#define DEEP_CTYPE_STREAM_WAV_FLOAT	0x50003
#define DEEP_CTYPE_STREAM_WAV_MP3	0x50055
#define DEEP_CTYPE_MUSIC_MOD	0x20000
#define DEEP_CTYPE_MUSIC_MTM	0x20001
#define DEEP_CTYPE_MUSIC_S3M	0x20002
#define DEEP_CTYPE_MUSIC_XM		0x20003
#define DEEP_CTYPE_MUSIC_IT		0x20004
#define DEEP_CTYPE_MUSIC_MO3	0x00100 

typedef struct {
	DWORD ctype;		
	const char *name;	
	const char *exts;	
} DEEP_PLUGINFORM;

typedef struct {
	DWORD version;					
	DWORD formatc;					
	const DEEP_PLUGINFORM *formats;	
} DEEP_PLUGININFO;

typedef struct DEEP_3DVECTOR {
#ifdef __cplusplus
	DEEP_3DVECTOR() {};
	DEEP_3DVECTOR(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {};
#endif
	float x;	
	float y;	
	float z;	
} DEEP_3DVECTOR;

#define DEEP_3DMODE_NORMAL		0
#define DEEP_3DMODE_RELATIVE	1
#define DEEP_3DMODE_OFF			2

#ifdef _WIN32
enum
{
    EAX_ENVIRONMENT_GENERIC,
    EAX_ENVIRONMENT_PADDEDCELL,
    EAX_ENVIRONMENT_ROOM,
    EAX_ENVIRONMENT_BATHROOM,
    EAX_ENVIRONMENT_LIVINGROOM,
    EAX_ENVIRONMENT_STONEROOM,
    EAX_ENVIRONMENT_AUDITORIUM,
    EAX_ENVIRONMENT_CONCERTHALL,
    EAX_ENVIRONMENT_CAVE,
    EAX_ENVIRONMENT_ARENA,
    EAX_ENVIRONMENT_HANGAR,
    EAX_ENVIRONMENT_CARPETEDHALLWAY,
    EAX_ENVIRONMENT_HALLWAY,
    EAX_ENVIRONMENT_STONECORRIDOR,
    EAX_ENVIRONMENT_ALLEY,
    EAX_ENVIRONMENT_FOREST,
    EAX_ENVIRONMENT_CITY,
    EAX_ENVIRONMENT_MOUNTAINS,
    EAX_ENVIRONMENT_QUARRY,
    EAX_ENVIRONMENT_PLAIN,
    EAX_ENVIRONMENT_PARKINGLOT,
    EAX_ENVIRONMENT_SEWERPIPE,
    EAX_ENVIRONMENT_UNDERWATER,
    EAX_ENVIRONMENT_DRUGGED,
    EAX_ENVIRONMENT_DIZZY,
    EAX_ENVIRONMENT_PSYCHOTIC,

    EAX_ENVIRONMENT_COUNT			
};

#define EAX_PRESET_GENERIC         EAX_ENVIRONMENT_GENERIC,0.5F,1.493F,0.5F
#define EAX_PRESET_PADDEDCELL      EAX_ENVIRONMENT_PADDEDCELL,0.25F,0.1F,0.0F
#define EAX_PRESET_ROOM            EAX_ENVIRONMENT_ROOM,0.417F,0.4F,0.666F
#define EAX_PRESET_BATHROOM        EAX_ENVIRONMENT_BATHROOM,0.653F,1.499F,0.166F
#define EAX_PRESET_LIVINGROOM      EAX_ENVIRONMENT_LIVINGROOM,0.208F,0.478F,0.0F
#define EAX_PRESET_STONEROOM       EAX_ENVIRONMENT_STONEROOM,0.5F,2.309F,0.888F
#define EAX_PRESET_AUDITORIUM      EAX_ENVIRONMENT_AUDITORIUM,0.403F,4.279F,0.5F
#define EAX_PRESET_CONCERTHALL     EAX_ENVIRONMENT_CONCERTHALL,0.5F,3.961F,0.5F
#define EAX_PRESET_CAVE            EAX_ENVIRONMENT_CAVE,0.5F,2.886F,1.304F
#define EAX_PRESET_ARENA           EAX_ENVIRONMENT_ARENA,0.361F,7.284F,0.332F
#define EAX_PRESET_HANGAR          EAX_ENVIRONMENT_HANGAR,0.5F,10.0F,0.3F
#define EAX_PRESET_CARPETEDHALLWAY EAX_ENVIRONMENT_CARPETEDHALLWAY,0.153F,0.259F,2.0F
#define EAX_PRESET_HALLWAY         EAX_ENVIRONMENT_HALLWAY,0.361F,1.493F,0.0F
#define EAX_PRESET_STONECORRIDOR   EAX_ENVIRONMENT_STONECORRIDOR,0.444F,2.697F,0.638F
#define EAX_PRESET_ALLEY           EAX_ENVIRONMENT_ALLEY,0.25F,1.752F,0.776F
#define EAX_PRESET_FOREST          EAX_ENVIRONMENT_FOREST,0.111F,3.145F,0.472F
#define EAX_PRESET_CITY            EAX_ENVIRONMENT_CITY,0.111F,2.767F,0.224F
#define EAX_PRESET_MOUNTAINS       EAX_ENVIRONMENT_MOUNTAINS,0.194F,7.841F,0.472F
#define EAX_PRESET_QUARRY          EAX_ENVIRONMENT_QUARRY,1.0F,1.499F,0.5F
#define EAX_PRESET_PLAIN           EAX_ENVIRONMENT_PLAIN,0.097F,2.767F,0.224F
#define EAX_PRESET_PARKINGLOT      EAX_ENVIRONMENT_PARKINGLOT,0.208F,1.652F,1.5F
#define EAX_PRESET_SEWERPIPE       EAX_ENVIRONMENT_SEWERPIPE,0.652F,2.886F,0.25F
#define EAX_PRESET_UNDERWATER      EAX_ENVIRONMENT_UNDERWATER,1.0F,1.499F,0.0F
#define EAX_PRESET_DRUGGED         EAX_ENVIRONMENT_DRUGGED,0.875F,8.392F,1.388F
#define EAX_PRESET_DIZZY           EAX_ENVIRONMENT_DIZZY,0.139F,17.234F,0.666F
#define EAX_PRESET_PSYCHOTIC       EAX_ENVIRONMENT_PSYCHOTIC,0.486F,7.563F,0.806F
#endif

#define DEEP_3DALG_DEFAULT	0
#define DEEP_3DALG_OFF		1
#define DEEP_3DALG_FULL		2
#define DEEP_3DALG_LIGHT	3

typedef DWORD (CALLBACK STREAMPROC)(HSTREAM handle, void *buffer, DWORD length, DWORD user);

#define DEEP_STREAMPROC_END		0x80000000	

#define DEEP_FILEPOS_CURRENT	0
#define DEEP_FILEPOS_DECODE		DEEP_FILEPOS_CURRENT
#define DEEP_FILEPOS_DOWNLOAD	1
#define DEEP_FILEPOS_END		2
#define DEEP_FILEPOS_START		3

#define DEEP_FILE_CLOSE		0
#define DEEP_FILE_READ		1
#define DEEP_FILE_LEN		3
#define DEEP_FILE_SEEK		4

typedef DWORD (CALLBACK STREAMFILEPROC)(DWORD action, DWORD param1, DWORD param2, DWORD user);

typedef void (CALLBACK DOWNLOADPROC)(const void *buffer, DWORD length, DWORD user);
#define DEEP_SYNC_POS	0
#define DEEP_SYNC_END		2
#define DEEP_SYNC_META		4
#define DEEP_SYNC_SLIDE		5
#define DEEP_SYNC_STALL		6
#define DEEP_SYNC_DOWNLOAD	7
#define DEEP_SYNC_FREE	8
#define DEEP_SYNC_MUSICPOS		10
#define DEEP_SYNC_MUSICINST	1
#define DEEP_SYNC_MUSICFX	3
#define DEEP_SYNC_MESSAGE	0x20000000	
#define DEEP_SYNC_MIXTIME	0x40000000	
#define DEEP_SYNC_ONETIME	0x80000000	

typedef void (CALLBACK SYNCPROC)(HSYNC handle, DWORD channel, DWORD data, DWORD user);

typedef void (CALLBACK DSPPROC)(HDSP handle, DWORD channel, void *buffer, DWORD length, DWORD user);

typedef BOOL (CALLBACK RECORDPROC)(HRECORD handle, const void *buffer, DWORD length, DWORD user);

#define DEEP_DATA_AVAILABLE	0			
#define DEEP_DATA_FLOAT		0x40000000	
#define DEEP_DATA_FFT512	0x80000000	
#define DEEP_DATA_FFT1024	0x80000001	
#define DEEP_DATA_FFT2048	0x80000002	
#define DEEP_DATA_FFT4096	0x80000003	
#define DEEP_DATA_FFT8192	0x80000004	
#define DEEP_DATA_FFT_INDIVIDUAL 0x10	
#define DEEP_DATA_FFT_NOWINDOW	0x20	

#define DEEP_TAG_ID3		0	
#define DEEP_TAG_ID3V2		1	
#define DEEP_TAG_OGG		2	
#define DEEP_TAG_HTTP		3	
#define DEEP_TAG_ICY		4	
#define DEEP_TAG_META		5	
#define DEEP_TAG_VENDOR		9	
#define DEEP_TAG_RIFF_INFO	0x100 
#define DEEP_TAG_MUSIC_NAME		0x10000	
#define DEEP_TAG_MUSIC_MESSAGE	0x10001	
#define DEEP_TAG_MUSIC_INST		0x10100	
#define DEEP_TAG_MUSIC_SAMPLE	0x10300	

#define DEEP_MUSIC_ATTRIB_AMPLIFY	0
#define DEEP_MUSIC_ATTRIB_PANSEP	1
#define DEEP_MUSIC_ATTRIB_PSCALER	2
#define DEEP_MUSIC_ATTRIB_BPM		3
#define DEEP_MUSIC_ATTRIB_SPEED		4
#define DEEP_MUSIC_ATTRIB_VOL_GLOBAL 5
#define DEEP_MUSIC_ATTRIB_VOL_CHAN	0x100 
#define DEEP_MUSIC_ATTRIB_VOL_INST	0x200 

#ifdef _WIN32
enum
{
	DEEP_FX_CHORUS,			
	DEEP_FX_COMPRESSOR,		
	DEEP_FX_DISTORTION,		
	DEEP_FX_ECHO,			
	DEEP_FX_FLANGER,		
	DEEP_FX_GARGLE,			
	DEEP_FX_I3DL2REVERB,	
	DEEP_FX_PARAMEQ,		
	DEEP_FX_REVERB			
};

typedef struct {
    float       fWetDryMix;
    float       fDepth;
    float       fFeedback;
    float       fFrequency;
    DWORD       lWaveform;	
    float       fDelay;
    DWORD       lPhase;		
} DEEP_FXCHORUS;		

typedef struct {
    float   fGain;
    float   fAttack;
    float   fRelease;
    float   fThreshold;
    float   fRatio;
    float   fPredelay;
} DEEP_FXCOMPRESSOR;	

typedef struct {
    float   fGain;
    float   fEdge;
    float   fPostEQCenterFrequency;
    float   fPostEQBandwidth;
    float   fPreLowpassCutoff;
} DEEP_FXDISTORTION;	

typedef struct {
    float   fWetDryMix;
    float   fFeedback;
    float   fLeftDelay;
    float   fRightDelay;
    BOOL    lPanDelay;
} DEEP_FXECHO;			

typedef struct {
    float       fWetDryMix;
    float       fDepth;
    float       fFeedback;
    float       fFrequency;
    DWORD       lWaveform;	
    float       fDelay;
    DWORD       lPhase;		
} DEEP_FXFLANGER;		

typedef struct {
    DWORD       dwRateHz;               
    DWORD       dwWaveShape;           
} DEEP_FXGARGLE;		

typedef struct {
    int     lRoom;                  
    int     lRoomHF;                
    float   flRoomRolloffFactor;    
    float   flDecayTime;            
    float   flDecayHFRatio;         
    int     lReflections;           
    float   flReflectionsDelay;     
    int     lReverb;                
    float   flReverbDelay;          
    float   flDiffusion;            
    float   flDensity;              
    float   flHFReference;          
} DEEP_FXI3DL2REVERB;	

typedef struct {
    float   fCenter;
    float   fBandwidth;
    float   fGain;
} DEEP_FXPARAMEQ;		

typedef struct {
    float   fInGain;                
    float   fReverbMix;             
    float   fReverbTime;            
    float   fHighFreqRTRatio;       
} DEEP_FXREVERB;		

#define DEEP_FX_PHASE_NEG_180        0
#define DEEP_FX_PHASE_NEG_90         1
#define DEEP_FX_PHASE_ZERO           2
#define DEEP_FX_PHASE_90             3
#define DEEP_FX_PHASE_180            4
#endif

#define DEEP_ACTIVE_STOPPED	0
#define DEEP_ACTIVE_PLAYING	1
#define DEEP_ACTIVE_STALLED	2
#define DEEP_ACTIVE_PAUSED	3

#define DEEP_SLIDE_FREQ	1
#define DEEP_SLIDE_VOL	2
#define DEEP_SLIDE_PAN	4

#define DEEP_INPUT_OFF		0x10000
#define DEEP_INPUT_ON		0x20000
#define DEEP_INPUT_LEVEL	0x40000

#define DEEP_INPUT_TYPE_MASK		0xff000000
#define DEEP_INPUT_TYPE_UNDEF		0x00000000
#define DEEP_INPUT_TYPE_DIGITAL		0x01000000
#define DEEP_INPUT_TYPE_LINE		0x02000000
#define DEEP_INPUT_TYPE_MIC			0x03000000
#define DEEP_INPUT_TYPE_SYNTH		0x04000000
#define DEEP_INPUT_TYPE_CD			0x05000000
#define DEEP_INPUT_TYPE_PHONE		0x06000000
#define DEEP_INPUT_TYPE_SPEAKER		0x07000000
#define DEEP_INPUT_TYPE_WAVE		0x08000000
#define DEEP_INPUT_TYPE_AUX			0x09000000
#define DEEP_INPUT_TYPE_ANALOG		0x0a000000

#define DEEP_CONFIG_BUFFER			0
#define DEEP_CONFIG_UPDATEPERIOD	1
#define DEEP_CONFIG_MAXVOL			3
#define DEEP_CONFIG_GVOL_SAMPLE		4
#define DEEP_CONFIG_GVOL_STREAM		5
#define DEEP_CONFIG_GVOL_MUSIC		6
#define DEEP_CONFIG_CURVE_VOL		7
#define DEEP_CONFIG_CURVE_PAN		8
#define DEEP_CONFIG_FLOATDSP		9
#define DEEP_CONFIG_3DALGORITHM		10
#define DEEP_CONFIG_NET_TIMEOUT		11
#define DEEP_CONFIG_NET_BUFFER		12
#define DEEP_CONFIG_PAUSE_NOPLAY	13
#define DEEP_CONFIG_NET_PREBUF		15
#define DEEP_CONFIG_NET_AGENT		16
#define DEEP_CONFIG_NET_PROXY		17
#define DEEP_CONFIG_NET_PASSIVE		18
#define DEEP_CONFIG_REC_BUFFER		19

DWORD DEEPDEF(DEEP_SetConfig)(DWORD option, DWORD value);
DWORD DEEPDEF(DEEP_GetConfig)(DWORD option);
DWORD DEEPDEF(DEEP_GetVersion)();
const char *DEEPDEF(DEEP_GetDeviceDescription)(DWORD device);
int DEEPDEF(DEEP_ErrorGetCode)();
#ifdef _WIN32
BOOL DEEPDEF(DEEP_Init)(int device, DWORD freq, DWORD flags, HWND win, const GUID *dsguid);
#else
BOOL DEEPDEF(DEEP_Init)(int device, DWORD freq, DWORD flags, void *win, void *dsguid);
#endif
BOOL DEEPDEF(DEEP_SetDevice)(DWORD device);
DWORD DEEPDEF(DEEP_GetDevice)();
BOOL DEEPDEF(DEEP_Free)();
#ifdef _WIN32
void *DEEPDEF(DEEP_GetDSoundObject)(DWORD object);
#endif
BOOL DEEPDEF(DEEP_GetInfo)(DEEP_INFO *info);
BOOL DEEPDEF(DEEP_Update)();
float DEEPDEF(DEEP_GetCPU)();
BOOL DEEPDEF(DEEP_Start)();
BOOL DEEPDEF(DEEP_Stop)();
BOOL DEEPDEF(DEEP_Pause)();
BOOL DEEPDEF(DEEP_SetVolume)(DWORD volume);
DWORD DEEPDEF(DEEP_GetVolume)();

HPLUGIN DEEPDEF(DEEP_PluginLoad)(const char *file, DWORD flags);
BOOL DEEPDEF(DEEP_PluginFree)(HPLUGIN handle);
const DEEP_PLUGININFO *DEEPDEF(DEEP_PluginGetInfo)(HPLUGIN handle);

BOOL DEEPDEF(DEEP_Set3DFactors)(float distf, float rollf, float doppf);
BOOL DEEPDEF(DEEP_Get3DFactors)(float *distf, float *rollf, float *doppf);
BOOL DEEPDEF(DEEP_Set3DPosition)(const DEEP_3DVECTOR *pos, const DEEP_3DVECTOR *vel, const DEEP_3DVECTOR *front, const DEEP_3DVECTOR *top);
BOOL DEEPDEF(DEEP_Get3DPosition)(DEEP_3DVECTOR *pos, DEEP_3DVECTOR *vel, DEEP_3DVECTOR *front, DEEP_3DVECTOR *top);
void DEEPDEF(DEEP_Apply3D)();
#ifdef _WIN32
BOOL DEEPDEF(DEEP_SetEAXParameters)(int env, float vol, float decay, float damp);
BOOL DEEPDEF(DEEP_GetEAXParameters)(DWORD *env, float *vol, float *decay, float *damp);
#endif

HMUSIC DEEPDEF(DEEP_MusicLoad)(BOOL mem, const void *file, DWORD offset, DWORD length, DWORD flags, DWORD freq);
BOOL DEEPDEF(DEEP_MusicFree)(HMUSIC handle);
DWORD DEEPDEF(DEEP_MusicSetAttribute)(HMUSIC handle, DWORD attrib, DWORD value);
DWORD DEEPDEF(DEEP_MusicGetAttribute)(HMUSIC handle, DWORD attrib);
DWORD DEEPDEF(DEEP_MusicGetOrders)(HMUSIC handle);
DWORD DEEPDEF(DEEP_MusicGetOrderPosition)(HMUSIC handle);

HSAMPLE DEEPDEF(DEEP_SampleLoad)(BOOL mem, const void *file, DWORD offset, DWORD length, DWORD max, DWORD flags);
void* DEEPDEF(DEEP_SampleCreate)(DWORD length, DWORD freq, DWORD chans, DWORD max, DWORD flags);
HSAMPLE DEEPDEF(DEEP_SampleCreateDone)();
BOOL DEEPDEF(DEEP_SampleFree)(HSAMPLE handle);
BOOL DEEPDEF(DEEP_SampleGetInfo)(HSAMPLE handle, DEEP_SAMPLE *info);
BOOL DEEPDEF(DEEP_SampleSetInfo)(HSAMPLE handle, const DEEP_SAMPLE *info);
HCHANNEL DEEPDEF(DEEP_SampleGetChannel)(HSAMPLE handle, BOOL onlynew);
DWORD DEEPDEF(DEEP_SampleGetChannels)(HSAMPLE handle, HCHANNEL *channels);
BOOL DEEPDEF(DEEP_SampleStop)(HSAMPLE handle);

HSTREAM DEEPDEF(DEEP_StreamCreate)(DWORD freq, DWORD chans, DWORD flags, STREAMPROC *proc, DWORD user);
HSTREAM DEEPDEF(DEEP_StreamCreateFile)(BOOL mem, const void *file, DWORD offset, DWORD length, DWORD flags);
HSTREAM DEEPDEF(DEEP_StreamCreateURL)(const char *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, DWORD user);
HSTREAM DEEPDEF(DEEP_StreamCreateFileUser)(BOOL buffered, DWORD flags, STREAMFILEPROC *proc, DWORD user);
BOOL DEEPDEF(DEEP_StreamFree)(HSTREAM handle);
DWORD DEEPDEF(DEEP_StreamGetFilePosition)(HSTREAM handle, DWORD mode);

const char *DEEPDEF(DEEP_RecordGetDeviceDescription)(DWORD device);
BOOL DEEPDEF(DEEP_RecordInit)(int device);
BOOL DEEPDEF(DEEP_RecordSetDevice)(DWORD device);
DWORD DEEPDEF(DEEP_RecordGetDevice)();
BOOL DEEPDEF(DEEP_RecordFree)();
BOOL DEEPDEF(DEEP_RecordGetInfo)(DEEP_RECORDINFO *info);
const char *DEEPDEF(DEEP_RecordGetInputName)(int input);
BOOL DEEPDEF(DEEP_RecordSetInput)(int input, DWORD setting);
DWORD DEEPDEF(DEEP_RecordGetInput)(int input);
HRECORD DEEPDEF(DEEP_RecordStart)(DWORD freq, DWORD chans, DWORD flags, RECORDPROC *proc, DWORD user);

float DEEPDEF(DEEP_ChannelBytes2Seconds)(DWORD handle, QWORD pos);
QWORD DEEPDEF(DEEP_ChannelSeconds2Bytes)(DWORD handle, float pos);
DWORD DEEPDEF(DEEP_ChannelGetDevice)(DWORD handle);
BOOL DEEPDEF(DEEP_ChannelSetDevice)(DWORD handle, DWORD device);
DWORD DEEPDEF(DEEP_ChannelIsActive)(DWORD handle);
BOOL DEEPDEF(DEEP_ChannelGetInfo)(DWORD handle, DEEP_CHANNELINFO *info);
const char *DEEPDEF(DEEP_ChannelGetTags)(DWORD handle, DWORD tags);
BOOL DEEPDEF(DEEP_ChannelSetFlags)(DWORD handle, DWORD flags);
BOOL DEEPDEF(DEEP_ChannelPreBuf)(DWORD handle, DWORD length);
BOOL DEEPDEF(DEEP_ChannelPlay)(DWORD handle, BOOL restart);
BOOL DEEPDEF(DEEP_ChannelStop)(DWORD handle);
BOOL DEEPDEF(DEEP_ChannelPause)(DWORD handle);
BOOL DEEPDEF(DEEP_ChannelSetAttributes)(DWORD handle, int freq, int volume, int pan);
BOOL DEEPDEF(DEEP_ChannelGetAttributes)(DWORD handle, DWORD *freq, DWORD *volume, int *pan);
BOOL DEEPDEF(DEEP_ChannelSlideAttributes)(DWORD handle, int freq, int volume, int pan, DWORD time);
DWORD DEEPDEF(DEEP_ChannelIsSliding)(DWORD handle);
BOOL DEEPDEF(DEEP_ChannelSet3DAttributes)(DWORD handle, int mode, float min, float max, int iangle, int oangle, int outvol);
BOOL DEEPDEF(DEEP_ChannelGet3DAttributes)(DWORD handle, DWORD *mode, float *min, float *max, DWORD *iangle, DWORD *oangle, DWORD *outvol);
BOOL DEEPDEF(DEEP_ChannelSet3DPosition)(DWORD handle, const DEEP_3DVECTOR *pos, const DEEP_3DVECTOR *orient, const DEEP_3DVECTOR *vel);
BOOL DEEPDEF(DEEP_ChannelGet3DPosition)(DWORD handle, DEEP_3DVECTOR *pos, DEEP_3DVECTOR *orient, DEEP_3DVECTOR *vel);
QWORD DEEPDEF(DEEP_ChannelGetLength)(DWORD handle);
BOOL DEEPDEF(DEEP_ChannelSetPosition)(DWORD handle, QWORD pos);
QWORD DEEPDEF(DEEP_ChannelGetPosition)(DWORD handle);
DWORD DEEPDEF(DEEP_ChannelGetLevel)(DWORD handle);
DWORD DEEPDEF(DEEP_ChannelGetData)(DWORD handle, void *buffer, DWORD length);
HSYNC DEEPDEF(DEEP_ChannelSetSync)(DWORD handle, DWORD type, QWORD param, SYNCPROC *proc, DWORD user);
BOOL DEEPDEF(DEEP_ChannelRemoveSync)(DWORD handle, HSYNC sync);
HDSP DEEPDEF(DEEP_ChannelSetDSP)(DWORD handle, DSPPROC *proc, DWORD user, int priority);
BOOL DEEPDEF(DEEP_ChannelRemoveDSP)(DWORD handle, HDSP dsp);
BOOL DEEPDEF(DEEP_ChannelSetLink)(DWORD handle, DWORD chan);
BOOL DEEPDEF(DEEP_ChannelRemoveLink)(DWORD handle, DWORD chan);
#ifdef _WIN32
BOOL DEEPDEF(DEEP_ChannelSetEAXMix)(DWORD handle, float mix);
BOOL DEEPDEF(DEEP_ChannelGetEAXMix)(DWORD handle, float *mix);
HFX DEEPDEF(DEEP_ChannelSetFX)(DWORD handle, DWORD type, DWORD priority);
BOOL DEEPDEF(DEEP_ChannelRemoveFX)(DWORD handle, HFX fx);

BOOL DEEPDEF(DEEP_FXSetParameters)(HFX handle, const void *par);
BOOL DEEPDEF(DEEP_FXGetParameters)(HFX handle, void *par);
#endif

#ifdef __cplusplus
}
#endif

#endif
